/****************************************************
          File Name:array_stack.c
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Mon 09 Feb 2015 10:52:34 AM CST
*****************************************************/

#include"array_stack.h"
#include<stdio.h>

int main(int argc, char *argv[])
{
    Stack s;

    InitStack(&s);

    int e;
    for(int i=0; i<MAX; i++)
    {
        printf("enter a string: ");
        scanf("%d", &e);
        Push(&s, &e);
    }
    printf("\nstack size: %d (before)\n\n", StackLength(&s));

    printf("pop stack members:\n");
    int res;
    for(int i=0; i<MAX; i++)
    {
        if(Pop(&s, &res))
            printf("\t\tpop: %d\n", res);
        else
            printf("pop failed\n");
    }
    printf("\nstack size: %d (after)\n", StackLength(&s));
    return 0;
}
